package com.vr.xuecheng.auth.controller;

import com.vr.xuecheng.auth.entity.User;
import com.vr.xuecheng.auth.mapper.UserMapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @author hzh
 * @date 2025/03/28
 * test登录的控制器
 */
@Slf4j
@RequiredArgsConstructor
@RestController
public class LoginController {
    private final UserMapper userMapper;
    @RequestMapping("/login-success")
    public String loginSuccess(){
        return "登录成功";
    }
    @GetMapping("/user/{id}")
    public User getuser(@PathVariable("id") String id){
        return userMapper.selectById(id);
    }

    @GetMapping("/r/r1")
    public String r1(){
        return "访问r1资源";
    }

    @GetMapping("/r/r2")
    public String r2(){
        return "访问r2资源";
    }
}
